{% extends "admin/base_site.html" %}
{% load i18n l10n admin_urls static %}

{% block extrahead %}
    {{ block.super }}
    {{ media }}
    <script src="{% static 'admin/js/cancel.js' %}" async></script>
{% endblock %}

{% block extrastyle %}{{ block.super }}
    <link rel="stylesheet" type="text/css" href="{% static "admin/css/forms.css" %}">{% endblock %}

{% block bodyclass %}{{ block.super }} app-{{ opts.app_label }} model-{{ opts.model_name }} delete-confirmation
    delete-selected-confirmation{% endblock %}

{% block breadcrumbs %}
    <div class="breadcrumbs">
        <a href="{% url 'admin:index' %}">{% translate 'Home' %}</a>
        &rsaquo; <a href="{% url 'admin:app_list' app_label=opts.app_label %}">{{ opts.app_config.verbose_name }}</a>
        &rsaquo; <a href="{% url opts|admin_urlname:'changelist' %}">{{ opts.verbose_name_plural|capfirst }}</a>
        &rsaquo; {% translate '上架题目' %}
    </div>
{% endblock %}

{% block content %}
    {% if descriotion %}
        <p>{{ descriotion }}</p>
    {% endif %}
    {% load i18n %}
    <h2>{% translate "Summary" %}</h2>
    <fieldset class="module aligned ">
        <div class="form-row field-password">
            <div><label>题目名称:</label>
                <p disabled id="id_name">{{ queryset.name }}</p></div>
            <div><label>题目类型:</label>
                <p disabled id="id_category">{{ queryset.category.name }}</p></div>
            <div>
                <label>环境类型:</label>
                <p disabled id="id_check_flag">
                    {% if queryset.check_flag == 1 %}
                        镜像环境
                    {% elif queryset.check_flag == 2 %}
                        附件环境
                    {% endif %}
                </p>
            </div>
            <div><label>题目分数:</label>
                <p disabled id="id_point">{{ queryset.point }} pt</p></div>
        </div>
    </fieldset>
    <form method="post">
        {% csrf_token %}
        <div>
            <input type="hidden" name="id" value="{{ queryset.id }}">
            <input type="hidden" name="post" value="yes">
            <input type="submit" value="{% translate 'Yes, I’m sure' %}">
            <a href="#" class="button cancel-link">{% translate "No, take me back" %}</a>
        </div>
    </form>
{% endblock %}
